package com.haitonghop.modules.local;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.Window;
import android.view.WindowManager;
import android.widget.CheckBox;

import com.haitonghop.R;
import com.haitonghop.utils.AppSettingParams;

public class SettingActivity extends Activity implements OnClickListener {
	CheckBox chapterCheckbox;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);

		this.requestWindowFeature(Window.FEATURE_NO_TITLE);

		// Remove notification bar
		this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
		setContentView(R.layout.setting_act);

		chapterCheckbox = (CheckBox) findViewById(R.id.chapterCheckbox);

		chapterCheckbox.setOnClickListener(this);
		chapterCheckbox.setChecked(AppSettingParams.isRevertChapter);
	}

	@Override
	public void onClick(View v) {
		if (v != null) {
			int id = v.getId();
			switch (id) {
			case R.id.chapterCheckbox:
				AppSettingParams.setReverChapter(getApplicationContext(), chapterCheckbox.isChecked());
				break;
			}
		}

	}
}
